<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>

<div class="page-title category-title">
	<h1><?php echo $this->category->title; ?></h1>
</div>

<div class="toolbar">
	<div class="pager">
		<p class="amount">
			<strong><?php echo $this->pagination->getResultsCounter(); ?></strong>
			<div class="pages">
				<strong><?php echo $this->pagination->getPagesLinks(); ?></strong>
			</div>
		</p>
	</div>
</div>
<div class="category-products">
	<ul class="products-grid row">
		<?php foreach ($this->items as $item) { ?>
			<li class="item first span3">
				<div class="products-box">
					<!-- <div class="products-new">New</div> -->
					<?php if ($item->discount) { ?>
						<div class="featured-product">Sale</div>
					<?php } ?>
					<a href="<?php echo $item->link; ?>" title="<?php echo $item->name; ?>" class="product-image">
						<img src="<?php echo $item->thumbnail; ?>" alt="<?php echo $item->name; ?>" />
					</a>
					<div class="shadow-s">&nbsp;</div>
					<div class="pro-info">
						<h2 class="product-name">
							<a href="<?php echo $item->link; ?>" title="<?php echo $item->name; ?>"><?php echo $item->name; ?></a>
						</h2>
					</div>
					<div class="price-box">
						<span class="regular-price">
							<span class="price">
								<?php echo number_format($item->discount > 0 ? $item->discount : $item->price, 0, ',', '.'); ?>
							</span>
						</span>
						<br />
						<?php if ($item->discount > 0) { ?>
							<span class="minimal-price-link">
								<span class="label">Giá gốc:</span>
								<span class="price">
									<?php echo number_format($item->price, 0, ',', '.'); ?>
								</span>
							</span>
						<?php } ?>
					</div>
					<div class="actions">
						<button type="button" title="Add to Cart" class="button btn-cart"
							onclick="window.location='<?php echo $item->cartLink; ?>';">
							<span>Mua Hàng</span>
						</button>
					</div>
					<div class="clear"></div>
				</div>
			</li>
	<?php } ?>
	</ul>
</div>
<div class="toolbar-bottom">
	<div class="toolbar">

		<div class="pager">
			<p class="amount">
				<strong><?php echo $this->pagination->getResultsCounter(); ?></strong>
				<div class="pages">
					<strong>Trang: </strong>
					<strong><?php echo $this->pagination->getPagesLinks(); ?></strong>
				</div>
			</p>
		</div>
	</div>
</div>
